<template>
  <div class="app-main-container tabpdding">
    <el-tabs v-model="activeTab">
      <el-tab-pane v-if="meta.indexOf('curriculumSales') > -1" :label="$t('message.kcxstj')" name="0">
		<div class="warnningTip">
				  <i class="el-icon-warning-outline" />
				   {{$t("message.xstjfsssjtj")}}
		</div>
		<CurriculumSales v-show="activeTab === '0'" />
	  </el-tab-pane>
      <el-tab-pane v-if="meta.indexOf('CourseSaleDetail') > -1" :label="$t('message.kcxsmx')" name="1"><CurriculumDetail v-if="activeTab === '1'" /></el-tab-pane>
      <el-tab-pane v-if="meta.indexOf('CourseTeacherCHSV') > -1" :label="$t('message.jlkstj')" name="2"><CurriculumTeacher v-if="activeTab === '2'" /></el-tab-pane>
      <!-- <el-tab-pane v-if="meta.indexOf('CurriculumDetailb') > -1" :label="$t('message.xskcbmmx')" name="2"><CurriculumDetailb v-if="activeTab === '2'" /></el-tab-pane> -->
    </el-tabs>
  </div>
</template>

<script>
import CurriculumDetail from './curriculumDetail'
// import CurriculumDetailb from './curriculumDetailb'
import CurriculumSales from './curriculumSales'
import CurriculumTeacher from './curriculumTeacher'
export default {
  name: 'CurriculumRela',
  components: {
    CurriculumDetail,
    // CurriculumDetailb,
    CurriculumTeacher,
    CurriculumSales
  },
  data() {
    return {
      activeTab: '0',
      meta: []
    }
  },
  created() {
    let activeTab = ''
    const meta = this.$route.meta.buttons || []
    if (meta.indexOf('curriculumSales') > -1) {
      activeTab = '0'
    } else if (meta.indexOf('CourseSaleDetail') > -1) {
      activeTab = '1'
    } else if (meta.indexOf('CourseTeacherCHSV') > -1) {
      activeTab = '2'
    }
    this.activeTab = activeTab
    this.meta = meta
  }

}
</script>

